package com.u3k.mid;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.u3k.app.mid.MiddleMain;

public class StartActionReceiver extends BroadcastReceiver {
    final /* synthetic */ MiddleMain a;

    public StartActionReceiver(MiddleMain middleMain) {
        this.a = middleMain;
    }

    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (action != null) {
            String appId = intent.getStringExtra(MiddleMain.ACTION_APPID);
            String channelId = intent.getStringExtra(MiddleMain.ACTION_CHANNELID);
            if (intent.getIntExtra(MiddleMain.ACTION_MIDDLE_HASH, 0) == this.a.hashCode()) {
                return;
            }
            if (action.equals(MiddleMain.MIDDLE_START_ACTION)) {
                if (appId != null && appId.equals(this.a.mAppId) && channelId != null && channelId.equals(this.a.mChannelId)) {
                    this.a.sendHaveStartAction(this.a.mContext);
                }
            } else if (action.equals(MiddleMain.MIDDLE_HAVE_START_ACTION) && appId != null && appId.equals(this.a.mAppId) && channelId != null && channelId.equals(this.a.mChannelId)) {
                this.a.mEnableStart = false;
            }
        }
    }
}
